// 
//
//
//
//
////#include "AVLTree.h"
////using namespace Hx;
////
////int main()
////{
////	int a[] = {1,2,3,4,5};
////	AVLTree<int,int> i;
////	for(int j = 0;j<sizeof(a)/sizeof(a[0]) ; j++)
////		i.Insert(make_pair(a[j],a[j]));
////	i.InOder();
////	return 0;
////}
//
//
//#include "RBTree.h"
////using namespace Hx;
//
//int main()
//{
//	int a[] = {1,2,3,4,5};
//	RBTree<int,int> i;
//	for(int j = 0;j<sizeof(a)/sizeof(a[0]) ; j++)
//		i.Insert(make_pair(a[j],a[j]));
//	i.InOder();
//	cout << i.IsBanlance() << endl;
//	return 0;
//}



#include "My_RBTree.h"
#include <vector>
#include <time.h>
#include <stdlib.h>


void test1()
{
	RBTree<int, int> rb1;
	int arr1[] = { 5, 4, 3, 2, 1, 0 };
	int arr2[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	int arr3[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	for (size_t i = 0; i < sizeof(arr1) / sizeof(arr1[0]); i++)
		rb1.Insert(make_pair(arr1[i], arr1[i]));

	//vector<int> v;
	//srand(time(0));
	//for (size_t i = 0; i < 100000; i++)
	//	v.push_back(rand());
	//for (size_t i = 0; i < v.size(); i++)
	//	rb1.Insert(make_pair(i,i));


	
	rb1.print_tree();
	rb1.IsBalance();
	cout << rb1.TreehHigh() << endl;
}

int main()
{
	test1();
	return 0;
}